// N4-N2语法题数据
export interface GrammarOption {
  id: string;
  text: string;
  isCorrect: boolean;
}

export interface GrammarExplanation {
  grammar: string;
  meaning: string;
  rule: string;
  example: string;
  translation: string;
}

export interface GrammarQuestion {
  id: number;
  level: string;
  question: string;
  options: GrammarOption[];
  explanation: GrammarExplanation;
}

export const grammarQuestions: GrammarQuestion[] = [
  // ...原始数据内容...
];

// 选项随机化函数
export const shuffleOptions = <T>(options: T[]): T[] => {
  const shuffled = [...options];
  for (let i = shuffled.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));
    [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
  }
  return shuffled;
}; 